package com.atguigu.scala.chapter5

/**
 * @author lizikuan
 * @date 2021/5/21 16:25
 */
/**
 * 柯里化
 */
object $02_Currying {
  def main(args: Array[String]): Unit = {
    println(m1(1, 2, 3))
    val m3_1 = m3(2)
    val m3_2 = m3_1(3)
    val m3_3 = m3_2(4)
    println(m3_3)
    println(m3(2)(4)(5))
  }

  def m1(x:Int,y:Int,z:Int) = x*y*z
  def m2(x:Int)(y:Int)(z:Int) = x*y*z

  def m3(x:Int) = {
    y:Int =>
      z:Int => x*y*z
  }
}
